#include "stdio.h"
#include "common.h"
#include "uart_reg.h"
#include "dmac_reg.h"
//#include "printf_func.h"
#include "printf.h"

//#define UART_BASE 0x85006000


//void uart0_init(int bps_cfg);
//void uart0_putchar(char tx_data);

/*int main()
{

  int   i,j;
  int   ret_value;
  int   tx_num;
   tx_num = 10;
 // printf_msg("------------uart initiating------------");
  uart0_init(0x82);
 // ret_value = read(UART0_LCR);
  //if (ret_value == 0x07){
  //    write(0x4201A140 ,0xffffffff);
  //    write(0x4201A140 ,0xfffcffff);
  //   print_c("HELLOW WORLD!");
      printf("tx_num is %d ",tx_num);
  //}
  
  //printf_msg("------------uart transmiting-----------");
  //tx_num = 0x55;
  //for(i=0;i<8;i++)  {
  //  uart0_putchar(tx_num);
  //  printf_msg("uart tx data : %x",tx_num); 
  //  tx_num += 0x11;
  //}
  //print("HELLOW WORLD!");
  //ret_value = 0;
  //print_flag(ret_value);
  while (1) {
 	 write(0x4201A140 ,0xffffffff);
 	 delay_nop(10);
 	 write(0x4201A140 ,0xfffcffff);	  
 	  };
  return 0;

}
*/

//void uart0_init(int bps_cfg)
//{
//  *(volatile unsigned int *)(UART0_LCR) = 0X80;
//  *(volatile unsigned int *)(UART0_DLL) = bps_cfg;
//  *(volatile unsigned int *)(UART0_LCR) = 0x07;
//  *(volatile unsigned int *)(UART0_IER) = 0x0f;
//  *(volatile unsigned int *)(UART0_FCR) = 0x31;
//
//}
//
//void uart0_putchar(char tx_data)
//{
//   int tx_fifo_lvl;
//   *(volatile unsigned char *)(UART0_THR) = tx_data;
//   do{
//     tx_fifo_lvl = *(volatile unsigned int  *)(UARTO_TFL);
//   //  printf_msg("tx_fifo level is : %x", tx_fifo_lvl);
//    } while (tx_fifo_lvl!=0);
//}
//
//
//void print(const char *ptr)
//{
//  while (*ptr != (char)0) {
//    uart0_putchar(*ptr);
//	ptr++;
//  }
//}
//
